import request from '../../utils/request'


/**
 * 获取收款人账户列表
 * @param cstId
 * @param page
 * @returns {Promise.<void>}
 */
export async function getRecAccList({cstId,status, page}) {
    return request(apiPath.mc + "/api/" + cstId + "/recaccs", {
        method: 'get',
        data: {status, page: page.page, size: page.size}
    });
}


/**
 * 获取收款人账户列表
 * @param cstId
 * @param page
 * @returns {Promise.<void>}
 */
export async function getRecAccListOfCstid({cstId}) {
    return request(apiPath.mc + "/api/" + cstId + "/recacc", {
        method: 'get',
    });
}


/**
 * 增加收款人账户
 * @param params
 * @returns {Promise.<void>}
 */
export async function addRecAcc({payeename, payeeno, openbank, bankbranch, payeeType, cstid}) {
    return request(apiPath.mc + "/api/recacc", {
        method: 'post',
        data: {payeename, payeeno, openbank, bankbranch, payeeType, cstid}
    });
}


/**
 * 更新收款人账户
 * @param params
 * @returns {Promise.<void>}
 */
export async function updateRecAcc({id, payeename, payeeno, openbank, bankbranch, payeeType, cstid}) {
    return request(apiPath.mc + "/api/recacc", {
        method: 'put',
        data: {id, payeename, payeeno, openbank, bankbranch, payeeType, cstid}
    });
}

/**
 * 根据id收款人账户
 * @param id
 * @returns {Promise.<void>}
 */
export async function getRecAccById({id}) {
    return request(apiPath.mc + "/api/recacc/"+ id, {
        method: 'get'
    });
}



/**
 * 删除收款人账户
 * @param id
 * @returns {Promise.<void>}
 */
export async function deleteRecAccById({id}) {
    return request(apiPath.mc + "/api/recacc/"+ id, {
        method: 'delete'
    });
}